package com.tl.app.service.impl;

import java.util.List;
import com.tl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tl.app.mapper.AppLeaveMapper;
import com.tl.app.domain.AppLeave;
import com.tl.app.service.IAppLeaveService;

/**
 * 留言板Service业务层处理
 * 
 * @author suhp
 * @date 2024-06-21
 */
@Service
public class AppLeaveServiceImpl implements IAppLeaveService 
{
    @Autowired
    private AppLeaveMapper appLeaveMapper;

    /**
     * 查询留言板
     * 
     * @param id 留言板主键
     * @return 留言板
     */
    @Override
    public AppLeave selectAppLeaveById(Long id)
    {
        return appLeaveMapper.selectAppLeaveById(id);
    }

    /**
     * 查询留言板列表
     * 
     * @param appLeave 留言板
     * @return 留言板
     */
    @Override
    public List<AppLeave> selectAppLeaveList(AppLeave appLeave)
    {
        return appLeaveMapper.selectAppLeaveList(appLeave);
    }

    /**
     * 新增留言板
     * 
     * @param appLeave 留言板
     * @return 结果
     */
    @Override
    public int insertAppLeave(AppLeave appLeave)
    {
        appLeave.setCreateTime(DateUtils.getNowDate());
        return appLeaveMapper.insertAppLeave(appLeave);
    }

    /**
     * 修改留言板
     * 
     * @param appLeave 留言板
     * @return 结果
     */
    @Override
    public int updateAppLeave(AppLeave appLeave)
    {
        appLeave.setUpdateTime(DateUtils.getNowDate());
        appLeave.setReplyTime(DateUtils.getNowDate());
        return appLeaveMapper.updateAppLeave(appLeave);
    }

    /**
     * 批量删除留言板
     * 
     * @param ids 需要删除的留言板主键
     * @return 结果
     */
    @Override
    public int deleteAppLeaveByIds(Long[] ids)
    {
        return appLeaveMapper.deleteAppLeaveByIds(ids);
    }

    /**
     * 删除留言板信息
     * 
     * @param id 留言板主键
     * @return 结果
     */
    @Override
    public int deleteAppLeaveById(Long id)
    {
        return appLeaveMapper.deleteAppLeaveById(id);
    }
}
